﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using L = Science.Mathematics.LinearAlgebra;

namespace Strang3Ed.Chapter06.Section4
{
    public class Example02
    {
        public Example02()
        {
        }
        private string result;
        public string Result
        {
            get { return result; }
        }
        public void Compute()
        {
            double[,] x = { {-3.0, 4.0}, 
                            {4.0, 3.0}};

            L.SymmetricMatrix A = new L.SymmetricMatrix(x);
            A.Diagonalize();

            result += A.Eigenvalue[0].ToString() + "\r\n";

            result += A.Eigenvector[0].ToString() + "\r\n";

            result += A.Eigenvalue[1].ToString() + "\r\n";

            result += A.Eigenvector[1].ToString() + "\r\n";
        }
    }
}
/*
5
0.447213595499958
0.894427190999916

-5
0.894427190999916
-0.447213595499958
*/
